document.querySelectorAll('.class')[0].textContent = 1254; //eq()

const getNodeindex = elm => [...elm.parentNode.children].indexOf(elm) //index()